Repository navigation
fix(dock): prevent overflow popup closing on app context menu - #1912
Merged
Merged
Conversation
Reviewer's GuideUITrack application context-menu state from AppItem in TaskOverflowButton and use it to keep the overflow popup open while the menu is active.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 3 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="panels/dock/taskmanager/package/AppItem.qml" line_range="604" />
<code_context>
}
function requestAppItemMenu() {
+ if (root.contextMenuGuard)
+ root.contextMenuGuard(true)
if (!root.preservePanelPopupOnContextMenu) {
</code_context>
<issue_to_address>
**Folder menus leave overflow open**
When a folder app in the overflow popup has its context menu dismissed, `requestAppItemMenu()` sets the guard and opens `FolderContextMenu` instead of the `contextMenuLoader` menu, whose hide callback clears the guard. `contextMenuActive` therefore remains true, `closeOnInactive` stays false, and the overflow popup remains open.
Clear the guard when `FolderContextMenu` closes, using the same reset behavior as the loader menu.
Also at `panels/dock/taskmanager/package/AppItem.qml:509`, `panels/dock/taskmanager/package/AppItem.qml:605`.
</issue_to_address>
### Comment 2
<location path="panels/dock/taskmanager/package/AppItem.qml" line_range="509" />
<code_context>
sourceComponent: LP.Menu {
id: contextMenu
+ onAboutToHide: Qt.callLater(function() {
+ if (MenuHelper.activeMenu === null && root.contextMenuGuard)
+ root.contextMenuGuard(false)
+ })
</code_context>
<issue_to_address>
**Replacement menus leave overflow open**
When another `MenuHelper` menu replaces an app context menu before the deferred hide callback runs, the deferred handler skips clearing the guard while the replacement menu is active, and that menu does not clear this AppItem's guard when it closes. `contextMenuActive` stays true, so `closeOnInactive` remains false and the overflow popup does not close on deactivation or outside clicks.
Keep the guard active while a replacement menu is open, then clear it when that menu closes.
</issue_to_address>
### Comment 3
<location path="panels/dock/taskmanager/package/TaskOverflowButton.qml" line_range="228" />
<code_context>
popupX: DockPanelPositioner.x
popupY: DockPanelPositioner.y
- closeOnInactive: MenuHelper.activeMenu === null && !Panel.contextDragging
+ closeOnInactive: !root.contextMenuActive
+ && MenuHelper.activeMenu === null && !Panel.contextDragging
</code_context>
<issue_to_address>
**Popup closes during focus handoff**
When the context menu closes while the overflow popup has not yet regained window activation, `closeOnInactive` becomes true as soon as the context-menu hide callback clears the guard. If the overflow window is still inactive while the window system is handing focus back from the menu, `PanelPopup`'s deferred inactive check closes it before focus returns, so dismissing the menu also closes the overflow popup.
Avoid re-enabling inactive closing until focus restoration has completed, or make the deferred close check account for the pending focus handoff.
</issue_to_address>
|
1. Add a contextMenuGuard callback to AppItem to signal context menu state 2. Notify TaskOverflowButton when an app context menu opens or hides 3. Use the guard flag to keep the overflow popup open while a menu is active Log: Keep the task overflow popup open when an app context menu is shown Influence: Prevents overflow popup from closing unexpectedly on right- click fix(dock): 修复右键菜单导致任务溢出弹窗关闭 1. 为 AppItem 增加 contextMenuGuard 回调以传递右键菜单状态 2. 应用右键菜单显示或隐藏时通知 TaskOverflowButton 3. 使用该标志避免菜单激活期间关闭溢出弹窗 Log: 避免应用右键菜单显示时任务溢出弹窗被意外关闭 Influence: 防止右键操作时溢出弹窗意外关闭 PMS: BUG-384793
wjyrich
force-pushed
the
fix-bug-384793
branch
from
December 1, 2026 03:29
4b7ee2a to
2f8526c
Compare
BLumia
approved these changes
Dec 1, 2026
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: BLumia, wjyrich The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Log: Keep the task overflow popup open when an app context menu is shown Influence: Prevents overflow popup from closing unexpectedly on right- click
fix(dock): 修复右键菜单导致任务溢出弹窗关闭
Log: 避免应用右键菜单显示时任务溢出弹窗被意外关闭
Influence: 防止右键操作时溢出弹窗意外关闭
PMS: BUG-384793
Summary by Sourcery
Bug Fixes: